﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LD
{
    public partial class FrmCCDSetting : FrmBase
    {
        public FrmCCDSetting()
        {
            InitializeComponent();
            this.lab_a_downccdResult.Text = "";
            this.lab_a_upccdResult.Text = "";
            this.lab_b_downccdResult.Text = "";
            this.lab_b_upccdResult.Text = "";
        }

        private void btn_a_upccdCalibration_Click(object sender, EventArgs e)
        {
            var result = SciHelper.Instance.标定("B轨上相机", "标定位", "B轨_CCD", "BD1", 0, 1);
            if (result)
                this.lab_a_upccdResult.Text = "标定成功";
            else
                this.lab_a_upccdResult.Text = "标定失败";
        }

        private void btn_a_downCCDCalibration_Click(object sender, EventArgs e)
        {
            var result = SciHelper.Instance.标定("B轨_组装", "标定位", "B轨_CCD", "BD2", 8, 2);
            if (result)
                this.lab_a_downccdResult.Text = "标定成功";
            else
                this.lab_a_downccdResult.Text = "标定失败";
        }

        private void btn_b_upccdCalibration_Click(object sender, EventArgs e)
        {
            var result = SciHelper.Instance.标定("A轨上相机", "标定位", "A轨_CCD", "BD3", 4, 5);
            if (result)
                this.lab_b_upccdResult.Text = "标定成功";
            else
                this.lab_b_upccdResult.Text = "标定失败";
        }

        private void btn_b_downCCDCalibration_Click(object sender, EventArgs e)
        {
            var result = SciHelper.Instance.标定("A轨_组装", "标定位", "A轨_CCD", "BD4", 9, 6);
            if (result)
                this.lab_b_downccdResult.Text = "标定成功";
            else
                this.lab_b_downccdResult.Text = "标定失败";
        }
        private void btn_setWindow_Click(object sender, EventArgs e)
        {
            SciHelper.Instance.GetSci.ShowMainWindow();
        }
    }
}
